#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include "../json/json.h"
#include "../json/parser.h"

using namespace std;

string &replace_all(string &str, const string &old_value, const string &new_value)
{
    while (true)
    {
        string::size_type pos(0);
        if ((pos = str.find(old_value)) != string::npos)
            str.replace(pos, old_value.length(), new_value);
        else
            break;
    }
    return str;
}

int main()
{
    ifstream ifn("/home/asukai/code/myJson/test.json");
    stringstream ss;
    ss << ifn.rdbuf();
    string str = ss.str();
    replace_all(str, " ", "");
    replace_all(str, "\n", "");
    replace_all(str, "\t", "");
    replace_all(str, "\b", "");
    replace_all(str, "\r", "");
    cout << str;
}